package com.xqq.lottery.protocal;

import org.xmlpull.v1.XmlSerializer;

public class Leaf {

	private String tagName;
	private String tagValue;
	
	public Leaf(String tagName){
		this.tagName = tagName;
	}
	
	public Leaf(String tagName,String tagValue){
		this.tagName = tagName;
		this.tagValue = tagValue;
	}
	
	public String getTagName() {
		return tagName;
	}

	public void setTagName(String tagName) {
		this.tagName = tagName;
	}

	public String getTagValue() {
		return tagValue;
	}

	public void setTagValue(String tagValue) {
		this.tagValue = tagValue;
	}

	public void serializerLeaf(XmlSerializer serializer){
		//��ǩ�Ŀ�ʼ ��ǩ�Ľ���
		try{
			serializer.startTag(null, tagName);
			if(tagValue == null){
				tagValue = "";
			}
			serializer.text(tagValue);
			serializer.endTag(null, tagName);			
		}catch(Exception e){
			e.printStackTrace();
		}

	}

}
